## Deserving Government Assistance? 
## Public Support for Aid to Struggling Firms and Workers
#############################################################
## Chris Witko
## Tobias Heinrich
#############################################################
## 0) Run it all
#############################################################

rm(list=ls())

## Load packages
################
library(plyr)
library(reshape2)
library(foreign)
library(jsonlite)
library(readstata13)
library(stringr)
library(arm)
library(emojifont)
library(matrixStats)
library(ggplot2)
library(ranger)
library(tmvtnorm)
library(AlgDesign)
library(ebal)


## Set/ create directories
##########################
setwd("/Users/th5/Dropbox/Projects/AI Projects/P5 - JobLoss")
dir.create(path="output", showWarnings = FALSE)


## Parallel options
###################
library(foreach)
library(doMC)
registerDoMC(cores=4)


## Run it all
#############
set.seed(101010)
source("code/01_Prepare conjoint draws.R")
source("code/02_Prepare data.R")
source("code/03_Analysis AMCEs.R")
source("code/04_Analysis ATMEs.R")
source("code/05_Analysis Het Treatment.R")
source("code/06_Descriptives.R")


